<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$return['diy']=$this->plugin_setting('diy');
if($_RQ['op']=='main'){
	
	exi($return);
}
/*******op*******/
if($_RQ['op']=='list'){
	$params=array('user_id'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']);
	$list=pdo_getall('jy_meifa_log',$params,'','','createtime desc');
	if($list){
		foreach($list as &$item){
			$user=pdo_get('core_members',array('id'=>$item['user_id'],'uniacid'=>$_SESSION['uniacid']));
			$order=pdo_get('jy_meifa_order',array('id'=>$item['order_id'],'uniacid'=>$_SESSION['uniacid']));
			$store=pdo_get('jy_meifa_store',array('id'=>$order['sid'],'uniacid'=>$_SESSION['uniacid']));
			$worker=pdo_get('jy_meifa_worker',array('id'=>$order['wid'],'uniacid'=>$_SESSION['uniacid']));
			$item['user_name']=$user['realname'];
			$item['user_nickname']=$user['nickname'];
			$item['store']=$store;
			$item['images']=json_decode($item['images'],true);
			$basic=$this->plugin_setting('basic');
			$item['service']=$basic['service'];
			$item['store_image']=$store['image'];
			$item['worker']=$worker;
	}
	
	}
	
	$return['list']=$list;
	exi($return);
}

if($_RQ['op']=='detail'){
	if(!$_RQ['id']){
		exi('记录不存在，请重新选择','error');
	}
    $log=pdo_get('jy_meifa_log',array('id'=>$_RQ['id'],'uniacid'=>$_SESSION['uniacid']));
	exi($return);
}
